﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HHHFramework {
    public class ResFactory
    {
        /// <summary>
        /// 创建一个res类 保存资源
        /// </summary>
        /// <param name="resSearchKeys"></param>
        /// <returns></returns>
        public static Res Create(ResSearchKeys resSearchKeys) {
            Res res = null;
            if (resSearchKeys.OwnerBundle != null)
            {
                res = new AssetRes(resSearchKeys);
            }
            else
            {
                if (resSearchKeys.AssetName.StartsWith("resources://"))
                {
                    res = new ResourcesRes(resSearchKeys);
                }
                else
                {
                    res = new AssetBundleRes(resSearchKeys);
                }
            }
            return res;
        }
    }
}

